package com.open.capacity.service.impl;

import com.open.capacity.mapper.OrderMapper;
import com.open.capacity.model.OrderVO;
import com.open.capacity.model.PageModel;
import com.open.capacity.service.Order2BusinessSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Order2BusinessServiceImpl implements Order2BusinessSerivce {

    @Autowired
    private OrderMapper mapper;

    @Override
    public List<OrderVO> invalid(Long id,PageModel pageModel) {
        Integer page = (pageModel.getPage()-1)*pageModel.getLimit();
        Integer limit = pageModel.getLimit();
        return mapper.invalid(id,page,limit);
    }
    @Override
    public List<OrderVO> underway(Long id,PageModel pageModel) {
        Integer page = (pageModel.getPage()-1)*pageModel.getLimit();
        Integer limit = pageModel.getLimit();
        return mapper.underway(id,page,limit);
    }
    @Override
    public List<OrderVO> completed(Long id, PageModel pageModel) {
        Integer page = (pageModel.getPage()-1)*pageModel.getLimit();
        Integer limit = pageModel.getLimit();
        return mapper.completed(id,page,limit);
    }

    @Override
    public Integer completedCount(Long id) {
        return mapper.completedCount(id);
    }

    @Override
    public Integer underwayCount(Long id) {
        return mapper.underwayCount(id);
    }

    @Override
    public Integer invalidCount(Long id) {
        return mapper.invalidCount(id);
    }
}
